package LinkedList;

public class _876_MiddleoftheLinkedList {
    public ListNode middleNode(ListNode head) {
        if(head==null) return null;
        ListNode tnode = head;
        ListNode fnode = head;
        while (tnode!=null && tnode.next != null && fnode!=null && fnode.next != null) {
            tnode = tnode.next;
            fnode = fnode.next.next;
        }
        return tnode;
    }
}
